package com.start.workflow.vo;

import com.start.common.std.IStartUserKey;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

@Data
public class StartCustomActAuthUser implements IStartUserKey {
    private String startUserType;
    private String userId;

    public StartCustomActAuthUser() {

    }

    public StartCustomActAuthUser(String startUserKey) {
        if (StringUtils.isAllBlank(startUserKey)) {
            return;
        }
        String[] split = startUserKey.split(":");
        startUserType = split[0];
        userId = split[1];
    }


    /**
     * 获取用户key 标准 用户体系:用户id 如：admin_user:123456dasfd
     *
     * @return
     */
    @Override
    public String getStartUserKey() {
        return startUserType + ":" + userId;
    }
}
